#include <convert_manager.h>
#include <stdio.h>


static PT_ConvertOpr g_ptConvertOpr_all = NULL;


void RegisterConvertOpr(PT_ConvertOpr ptConvertOpr)
{
    ptConvertOpr->ptNext = g_ptConvertOpr_all;
    g_ptConvertOpr_all = ptConvertOpr;
}


void RegisterAllConvertOpr(void)
{
    RegisterMjpeg2Rgb();
    RegisterRgb2Rgb();
    RegisterYuv2Rgb();
}



void ShowConvertOprList(viod)
{   
    int i = 0;
    PT_ConvertOpr p_tmp = g_ptConvertOpr_all;
    while(p_tmp)
    {
        printf("%02d %s\n", i++, p_tmp->name);
		p_tmp = p_tmp->ptNext;
    }
}



PT_ConvertOpr GetConvertOprByName(char *name)
{
    PT_ConvertOpr p_tmp = g_ptConvertOpr_all;
    while (p_tmp)
    {
        if (strcmp(p_tmp->name, name) == 0)
        {
            return p_tmp;
        }
        p_tmp = p_tmp->ptNext;
    }
    return NULL;
}